package cn.ywsj.ywsjmidtier.controller;


import cn.ywsj.ywsjmidtier.entity.VO.NewsQueryVo;
import cn.ywsj.ywsjmidtier.service.WechatNewsFeign;
import cn.ywsj.ywsjmidtier.utils.JsonObjectUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wechat/newsmgr")
public class WechatNewsController {

    @Autowired
    private WechatNewsFeign newsFeign;

    @RequestMapping({"/newsdetail"})
    public String companyNewsDetail(NewsQueryVo newsQueryVo) {
        return newsFeign.companyNewsDetail(JsonObjectUtil.ObjectToJson(newsQueryVo));
    }

    @PostMapping(value = {"/ajaxnewspage"})
    public String ajaxNewsPage(String topClassId, NewsQueryVo newsQueryVo) {
      return newsFeign.ajaxNewsPage(topClassId,JsonObjectUtil.ObjectToJson(newsQueryVo));
    }
}
